﻿{extend name="$index_style_layout" /}

<!--SEO相关-->
{block name="head_title"}{$webdb.mseo_title?:$webdb.seo_title}{/block}
{block name="head_keword"}{$webdb.mseo_keyword?:$webdb.seo_keyword}{/block}
{block name="head_description"}{$webdb.mseo_description?:$webdb.seo_description}{/block}

{block name="nav"}{qb:nav title="会员榜单" url="" /}{/block}
 
{block name="body_content"}
 
  <link rel="stylesheet" href="__STATIC__/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="__STATIC__/layui/css/admin.css" media="all">
  <link rel="stylesheet" href="__STATIC__/layui/css/template.css" media="all">

<div style="width:1200px;margin:auto;margin-top:20px;margin-bottom:20px;background:#F7F7F7;">

<div class="layui-fluid layadmin-homepage-fluid">
  <div class="layui-row layui-col-space8">
    
	<div class="layui-row  layadmin-homepage-padding8" style="margin-top:12px;">		
          
		  <div class="layui-col-md6">
		      <a href="javascript:;" onclick="choose_type(0)" class="layui-btn layui-btn-danger">积分排名榜</a>              
              <a href="javascript:;" onclick="choose_type(1)" class="layui-btn">余额排名榜</a>
          </div>

          <div class="layui-col-md6 layadmin-homepage-padding8">
            <div class="layui-row layadmin-homepage-text-center">
			  <div class="layui-col-md4 layui-col-sm4 layui-col-xs3">			  
              </div>                            
              <div class="layui-col-md4 layui-col-sm4 layui-col-xs3 layui-col-md-offset9">
				<a href="{:purl('signin/index/index',[],'index')}" class="layui-btn  layui-btn-warm">签到排名</a>
              </div>
            </div>
          </div>
          <hr class="new-section-xs"></hr>
        </div>
	
    <div class="layui-col-md12">
      <div class="layui-fluid layadmin-homepage-content">
        
        <div class="layui-row  layadmin-homepage-list-imgtxt">
          <div class="layui-col-md9">
				<div class="layui-fluid layui-row" style="padding-left:0;padding-top:3px;">

					<ul class="layui-fluid layui-row layui-col-space1 pc_marking_index001" style="padding:0;">
					{qb:tag name="pc_marking_index001" js="pc_marking_index001" type="member" union="order" order="money" by="desc" rows="20"}
					<div class="layui-col-md3">
					  <div class="layui-card layadmin-homepage-text-center">
						<a href="{$rs.url}" target="_blank"><div class="layadmin-homepage-pad-ver">
						  <img onerror="this.src='__STATIC__/images/nobody.gif'" class="layadmin-homepage-pad-img" src="{$rs.icon}" width="96" height="96">
						</div>
						<h4 class="layadmin-homepage-font" style="height:25px;">{$rs.username}</h4> </a>
						<div class="layadmin-homepage-pad-ver" style="text-align:left;">						
						<a href="javascript:;" style="color:#ccc;" class="fa fa-database"></a>积分: {$rs.money} 个<br>
						<a href="javascript:;" style="color:#ccc;" class="glyphicon glyphicon-yen"></a>余额: {:preg_replace('/^([\\d]*)(\\d)\\./','**\\\\2.',$rs.rmb)} 元						
						</div>             
					  </div>
					</div>
					{/qb:tag}
					</ul>
					 
				</div>
			
          </div>
          <div class="layui-col-md3">
            <div class="grid-demo">


		<!--我的相关开始-->
      <div class="layadmin-homepage-panel layadmin-homepage-shadow">
        <div class="layui-card text-center">
			<!--每天签到-->
		   
          <div class="layui-card-body">
            <div class="layadmin-homepage-pad-ver">

              <img onerror="this.src='__STATIC__/images/nobody.gif'" class="layadmin-homepage-pad-img" src="{$userdb?get_user_icon($userdb.uid):''}" width="96" height="96">
            </div>
            <h4 class="layadmin-homepage-font">{$userdb?get_user_name($userdb.uid):'游客'}</h4>
            {notempty name="$userdb"}
			 <p class="layadmin-homepage-min-font">级别:{:getGroupByid(get_user($userdb.uid)['groupid'])}</p>
			 <p>积分:{$userdb.money} 个</p>
            <p>余额:{$userdb.rmb} 元</p> 
			{/notempty}
			{empty name="$userdb"}
			<button class="layui-btn layui-btn-fluid" onclick="window.location.href='{:get_url('login')}'">登录</button>
			{else /}
			<a href="{:get_url('user',$userdb.uid)}"><button class="layui-btn layui-btn-fluid">我的主页</button></a>
			{/empty}            
          </div>
        </div>
        
      </div>
    <!--我的相关结束-->
	
              <div class="layui-card homepage-bottom">
                <div class="layui-card-header">
                  <h3 class="panel-title">
                    <i class="layui-icon layui-icon-fire"></i>
                    最新注册用户
                  </h3>
                </div>
                <div class="layui-card-body pc_marking_index002">
					{qb:tag name="pc_marking_index002" js="pc_marking_index002" type="member" order="uid" by="desc" rows="12"}
                    <a href="{$rs.url}" target="_blank" class="layadmin-privateletterlist-item">
                      <div class="meida-left">
                        <img onerror="this.src='__STATIC__/images/nobody.gif'" src="{$rs.uid|get_user_name}">
                      </div>
                      <div class="meida-right">
                        <p>{$rs.username}</p>
                        <mdall><i class="si si-clock"></i> {$rs.regdate|format_time=true}</mdall>
                      </div>
                    </a>
                    {/qb:tag}
                  </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</div>

<style type="text/css">
.topUpCont{
	position: fixed;
	width: 80px;
	border: #DDD solid 1px;
	background: #FFF;
	z-index: 10000;
	right:10px;
	bottom: 10px;
	border-radius: 5px;
	text-align: center;
	padding: 10px 0px;
	line-height: 20px;
	cursor: pointer;
	color: #999;
	display: none;
}
.topUpCont i{
	font-size:20px
}
.topUpCont:hover{
	border:#F60 solid 1px;
	background: #F90;
	color: #FFF;
}
</style>
<div class="topUpCont">
    <ul>
    	<ol><i class="fa fa-angle-double-up"></i></ol>
        <li>回到顶部</li>
    </ul>
</div>


<script type="text/javascript">

var Mpage = [];	//存放分页码
var default_i = 0; //默认显示第一个
var urldb = ['money','rmb'];
function ShowMoreInfo(){
	if(Mpage[default_i]==undefined){
		Mpage[default_i] = 1;
	}
	Mpage[default_i]++;
	layer.load(1);
	var url = "{qb:url name='pc_marking_index001' /}" + Mpage[default_i] + '&order=' + urldb[default_i];
	$.get(url,function(res){
		layer.closeAll();
		if(res.code==0){
			if(res.data==''){
				if(Mpage[default_i]==1){
					$(".pc_marking_index001").html("");
					layer.msg("没有记录",{time:500});
				}else{
					layer.msg("已经显示完了！",{time:500});
				}
				
			}else{
				if(Mpage[default_i]==1){
					$(".pc_marking_index001").html(res.data);
				}else{
					$(".pc_marking_index001").append(res.data);
				}
				scroll_get = true;
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}

//滚动显示更多
var scroll_get  = true;	//做个标志,不要反反复复的加载
$(document).ready(function () {
	$(window).scroll(function () {
		if (scroll_get==true &&  (200 + $(window).scrollTop())>($(document).height() - $(window).height())) {
			scroll_get = false;
			layer.msg('内容加截中,请稍候',{time:1000});
			ShowMoreInfo();
		}

		if ($(window).scrollTop() > 100) {
			$(".topUpCont").show();
		} else {
			$(".topUpCont").hide();
		}

	});

	$(".topUpCont").click(function () {
		$("html,body").animate({scrollTop:0},500);
	});
});

//切换显示
function choose_type(i){
	default_i = i;
	Mpage[default_i] = 0;
	scroll_get = true;
	ShowMoreInfo();
}


</script>

{/block}